use evolution::World;
use std::io::stdin;

mod click_set;
mod coordinate;
mod direction;
mod evolution;
mod layout;
mod state;
mod strategy;

fn main() {
    let mut s = String::new();
    let step = stdin().lines().next().unwrap().unwrap().parse().unwrap();
    while stdin().read_line(&mut s).unwrap() != 0 {}
    let state = s.parse().unwrap();
    let mut world = World::new(&state, 90, 150, step);
    for i in 0..=10000 {
        world.run();
        if i % 500 == 0 {
            println!("{i}\t{}", world.best().score * 90);
        }
    }
    for coord in world.best().iter_clicks() {
        println!("{coord}");
    }
}
